package com.rockcent.mall.lib.repository;


import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.MerchantCoupon;
import com.rockcent.mall.lib.domain.enumclass.CouponUseScope;
import com.rockcent.mall.lib.domain.enumclass.MerchantCouponStatus;
import com.rockcent.mall.lib.dto.IntegrationCouponRespDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Created by oyhk on 16/2/5.
 */
@Repository
public interface MerchantCouponRepository extends JpaRepository<MerchantCoupon, Long>, JpaSpecificationExecutor, MerchantCouponRepositoryCustom {


    MerchantCoupon findByIdAndMerchantId(Long id, Long merchantId);

    MerchantCoupon findByIdAndStatus(Long couponId, MerchantCouponStatus issued);


    List<MerchantCoupon> findByMerchantIdAndUseScope(Long merchantId, CouponUseScope allProduct);

    MerchantCoupon findByIdAndMallId(Long id, Long mallId);


}